package day8.race;

/**
 * @author oldliu
 * @since 1.0
 */
public class RaceTest {
    public static void main(String[] args) {
        Race r=new Race("合肥滨湖国际马拉松",1000);
        Player []p=new Player[20];
        for(int i=0;i<p.length;i++){
            p[i]=new Player("刘"+i,r);
            p[i].start();
        }
        //join

        //等待
        while(Thread.activeCount()>2){
            //System.out.println(Thread.activeCount()+"个活动线程！");
        }

        for(int i=0;i<p.length;i++){
            System.out.println(p[i].getName()+"的名次是："+p[i].getPosition());
        }
    }
}
